home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / documents / ELF / elf_hash3E.txt < prev    next >
Encoding:
Text File  |  1996-11-11  |  1.2 KB  |  34 lines

  1.  
  2. elf_hash(3E)                   Silicon Graphics                   elf_hash(3E)
  3.  
  4. NAME
  5.      elf_hash - compute hash value
  6.  
  7. SYNOPSIS
  8.      cc [flag ...] file ...  -lelf [library ...]
  9.  
  10.      #include <libelf.h>
  11.  
  12.      unsigned long elf_hash(const char *name);
  13.  
  14. DESCRIPTION
  15.      elf_hash computes a hash value, given a null terminated string, name.
  16.      The returned hash value, h, can be used as a bucket index, typically
  17.      after computing h mod x to ensure appropriate bounds.
  18.  
  19.      Hash tables may be built on one machine and used on another because
  20.      elf_hash uses unsigned arithmetic to avoid possible differences in
  21.      various machines' signed arithmetic.  Although name is shown as char*
  22.      above, elf_hash treats it as unsigned char* to avoid sign extension
  23.      differences.  Using char* eliminates type conflicts with expressions such
  24.      as elf_hash("name").
  25.  
  26.      ELF files' symbol hash tables are computed using this function [see
  27.      elf_getdata(3E) and elf_xlate(3E)].  The hash value returned is
  28.      guaranteed not to be the bit pattern of all ones (~0UL).
  29.  
  30. SEE ALSO
  31.      elf(3E), elf_getdata(3E), elf_xlate(3E).
  32.  
  33. Page 1                           Release 6.2
  34.